<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>02_模板语法</title>
</head>

<body>
    <div id="app">
        <h1>1.双大括号表达式</h1>
        <p>来自双大花括号的内容---{{msg}}</p>

        <!-- 将内容转化为大写 -->
        <p>将大花括号内的内容大写---{{msg.toUpperCase()}}</p>

        <!-- v-html: 若内容是html标签,则将内容解析成html标签;若是纯文本,则纯文本显示-->
        <p v-html="msg"></p>

        <h1>2.指令一(v-bind):强制数据绑定</h1>
        <img src="imgUrl" alt="">
        <img v-bind:src="imgUrl" alt="" width="50px" height="50px"> <br>
        <!--v-bind:简写-->
        <img :src="imgUrl" alt="" width="100px" height="100px">


        <h1>3.指令二(v-on):绑定事件监听</h1>
        <button v-on:click="hehe">button</button>
        <!--事件绑定简写-->
        <button @click="hehe1(msg)">button</button>
    </div>
</body>
<script type="text/javascript" src="../vue.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            msg: '<a href="https://cn.vuejs.org">Vue官网</a>',
            imgUrl: 'https://cn.vuejs.org/images/logo.png',
        },
        methods: {
            hehe() {
                alert('哈哈哈哈')
            },
            hehe1(content) {
                alert(content)
            }
        }
    });
</script>

</html>